﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true"
	CodeBehind="Carrinho.aspx.cs" Inherits="WebApplication1.Carrinho" %>

<%@ Register Src="Endereco.ascx" TagName="Endereco" TagPrefix="uc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
	<asp:Panel runat="server" ID="pnlNotVazio">
		<asp:Repeater runat="server" ID="rptCarrinho" OnItemDataBound="rptCarrinho_ItemDataBound">
			<HeaderTemplate>
				<table border="1" width="100%">
					<tr>
						<th>
							Excluir
						</th>
						<th>
							Produto
						</th>
						<th>
							Preço
						</th>
					</tr>
			</HeaderTemplate>
			<ItemTemplate>
				<tr>
					<td align="center">
						<asp:LinkButton runat="server" ID="lnkRemove" Text="[ X ]" OnClick="lnkRemove_Click"></asp:LinkButton>
					</td>
					<td>
						<asp:Literal runat="server" ID="litNome"></asp:Literal>
					</td>
					<td>
						<asp:Literal runat="server" ID="litPreco"></asp:Literal>
					</td>
				</tr>
			</ItemTemplate>
			<FooterTemplate>
				<tr>
					<td colspan="23" align="right">
						<b>Total :
							<asp:Literal runat="server" ID="litTotal"></asp:Literal></b>
					</td>
				</tr>
				</table>
			</FooterTemplate>
		</asp:Repeater>
		<br />
		<br />
		<table border="1" width="100%">
			<tr>
				<td>
					Tipo de entrega :
				</td>
				<td>
					<asp:RadioButtonList runat="server" ID="rblTipo">
						<asp:ListItem Value="1" Text="Transporte Aéreo"></asp:ListItem>
						<asp:ListItem Value="2" Text="Transporte Rodoviário" Selected="true"></asp:ListItem>
						<asp:ListItem Value="3" Text="Transp. Rodoviário Prioritário"></asp:ListItem>
					</asp:RadioButtonList>
				</td>
			</tr>
			<tr>
				<td>
					CEP de entrega (XXXXX-XXX): 
				</td>
				<td>
					<asp:TextBox runat="server" CssClass="cep" ID="txtCEP" ValidationGroup="CEP"></asp:TextBox>
					<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="RequiredFieldValidator"
						ValidationGroup="CEP" ControlToValidate="txtCEP">*</asp:RequiredFieldValidator>
					<asp:Button runat="server" ID="btnCalcular" ValidationGroup="CEP" Text="Calcular"
						OnClick="btnCalcular_Click" />
				</td>
			</tr>
			<asp:Panel runat="server" ID="pnlFreteResultado" Visible="false">
				<tr>
					<td>
					</td>
					<td colspan="200">
						<asp:Literal runat="server" ViewStateMode="Disabled" ID="litValorFrete" Text="Valor: {0}"></asp:Literal>
					</td>
				</tr>
				<tr>
					<td>
					</td>
					<td colspan="200">
						<asp:Literal runat="server" ViewStateMode="Disabled" ID="litTempoFrete" Text="Tempo estimado de entrega: {0} dias"></asp:Literal>
					</td>
				</tr>
				<tr>
					<td>
					</td>
					<td colspan="200">
						<uc1:Endereco ID="Endereco1" ViewStateMode="Disabled" TituloEndereco="Endereço de entrega" runat="server" />
					</td>
				</tr>
				<tr>
					<td>
					</td>
					<td align="center">
						<asp:Button runat="server" ViewStateMode="Disabled" ID="btnProximoPasso" Text="Próximo passo" OnClick="btnProximoPasso_Click" />
					</td>
				</tr>
			</asp:Panel>
		</table>
	</asp:Panel>
	<asp:Panel runat="server" ID="pnlVazio">
		<asp:Literal runat="server" ID="litCarrinhoVazio" Text="Seu carrinho  está vazio"></asp:Literal>
	</asp:Panel>

    <script type="text/javascript">

        $(document).ready(function () {
            $(".cep").mask("99999-999");
         });

    </script>
</asp:Content>
